<template>
  <div v-if="show" class="fontDa">
    <div class="score">{{ cepingHdglXpxxb.cphzfz }} 分</div>
    <div class="customTableHeader">
      <!--      <div class="customTableTitle">{{ cepingHdglb.hdName }}</div>-->
      <div class="customTableTitle">{{ cepingHdglCppmxbInfo.cppName }}</div>
      <!-- <div class="customTableSummary flex justifyContentSpaceBetween" style=" position:relative; margin-top:-25px;">


      </div> -->

      <div
        style="
          display: flex;
          justify-content: space-between;
          padding-bottom: 10px;
        "
      >
        <div class="zhaoPian">
          <span v-if="cepingHdglXpxxb.bcpDx == '部门'"
           style="font-weight:bold;"
            >测评对象：{{ cepingHdglXpxxb.bcpDeptName }}</span
          >
          <span v-else>
            <el-row>
              <el-col :span="3">
                <el-popover
                  v-if="cepingCpgzBcpmxbUser && cepingCpgzBcpmxbUser.avatar"
                  placement="right"
                  trigger="hover"
                >
                  <img
                    :src="cepingCpgzBcpmxbUser && cepingCpgzBcpmxbUser.avatar"
                    style="height: 380px"
                  />
                  <img
                    slot="reference"
                    :src="cepingCpgzBcpmxbUser && cepingCpgzBcpmxbUser.avatar"
                    style="width: 65px; height: 90px"
                  />
                </el-popover>
                <img
                  v-else
                  src="/img/avatar.jpg"
                  style="
                    width: 65px;
                    height: 90px;
                    display: block;
                    border-radius: 3px;
                  "
                />
              </el-col>
              <el-col :span="21">
                <el-row style="margin-top: 20px"
                  >测评对象：{{
                    cepingCpgzBcpmxbUser && cepingCpgzBcpmxbUser.ryName
                  }}</el-row
                >
                <!--                <el-row>{{ cepingCpgzBcpmxbUser.deptName + ' ' + cepingCpgzBcpmxbUser.ryZw }}</el-row>-->
                <el-row>{{
                  cepingCpgzBcpmxbUser && cepingCpgzBcpmxbUser.ryZw
                }}</el-row>
              </el-col>
            </el-row>
          </span>
        </div>
        <div>
          <el-button
            type="primary"
            icon="el-icon-document"
            :underline="false"
            style="margin-left: 20px"
            @click="viewBg(cepingHdglXpxxb)"
          >
            {{ cepingHdglXpxxb.bcpDx == "部门" ? "查看报告" : "查看报告" }}
          </el-button>
          <el-button
            type="primary"
            icon="el-icon-collection"
            :underline="false"
            style="margin-left: 20px"
            @click="viewGz"
          >
            评价标准
          </el-button>
        </div>
      </div>
    </div>
    <div class="cpTable fontDa">
      <!--      height="calc(100vh - 390px)"-->
      <el-table
        :data="tableData"
        :span-method="objectSpanMethod"
        border
        height="calc(100vh - 500px)"
        :row-class-name="tableRowClassName"
      >
        <el-table-column
          prop="zbName1"
          label="一级指标"
          align="center"
          min-width="300"
          class="td1"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.zbName3 || scope.row.zbName2">
              {{ scope.row.zbName1 }}</span
            >
            <el-popover
              v-else
              placement="top-start"
              :title="scope.row.zbName1"
              width="700"
              :placement="shuxing"
              trigger="hover"
              :content="decodeURIComponent(decodeURIComponent(scope.row.tsNr))"
              popper-class="newline"
            >
              <el-link
                slot="reference"
                type="primary"
                :underline="false"
                style="margin-left: 5px; font-size: 24px !important"
              >
                {{ scope.row.zbName1 }}
              </el-link>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="zbName2"
          label="二级指标"
          align="center"
          min-width="280"
          v-if="zbCj > 1"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.zbName3">{{ scope.row.zbName2 }}</span>
            <el-popover
              v-else
              placement="top-start"
              :title="scope.row.zbName2"
              width="700"
              trigger="hover"
              :placement="shuxing"
              :content="decodeURIComponent(decodeURIComponent(scope.row.tsNr))"
              popper-class="newline"
            >
              <el-link
                slot="reference"
                type="primary"
                :underline="false"
                style="margin-left: 5px; font-size: 24px !important"
              >
                {{ scope.row.zbName2 }}
              </el-link>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          prop="zbName3"
          label="三级指标"
          align="center"
          min-width="280"
          v-if="zbCj > 2"
        >
          <template slot-scope="scope">
            <el-popover
              placement="top-start"
              :title="scope.row.zbName3"
              width="700"
              trigger="hover"
              :placement="shuxing"
              :content="decodeURIComponent(decodeURIComponent(scope.row.tsNr))"
              popper-class="newline"
            >
              <el-link
                slot="reference"
                type="primary"
                :underline="false"
                style="margin-left: 5px; font-size: 24px !important"
              >
                {{ scope.row.zbName3 }}
              </el-link>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column
          v-for="(h, i) in tableHeader"
          :key="i"
          :label="h"
          align="center"
        >
          <el-table-column
            v-for="(gz, j) in tableColumn"
            :key="j + 10000"
            :label="gz.fzMc"
            v-if="gz.fzSsz == h"
            align="center"
            :fzIndex="j"
          >
            <template slot-scope="scope">
              <el-button
                type="text"
                icon="el-icon-success"
                class="cpCheck"
                v-if="scope.row.fzId == gz.id"
              ></el-button>
              <el-button
                type="text"
                class="cpCheck"
                v-else
                @click="cpDaFen(scope.$index, gz)"
                ><i class="noChecked"></i>
              </el-button>
            </template>
          </el-table-column>
        </el-table-column>
      </el-table>
      <!--      <div class="zfheaderbox" v-if="cepingDjmxbList!=null&&cepingDjmxbList.length>0">-->
      <!--        <div class="kaohe-firsttitle">评价等次：</div>-->
      <!--        <div class="flex customRadioNewBox">-->
      <!--          <label :class="'flex footitem'" v-for="(d,i) in cepingDjmxbList" :key="i" :for="i">-->
      <!--            <div>{{ d.dcName }}</div>-->
      <!--            <div class="customRadioNew">-->
      <!--              <input :id="i" type="radio" name="pjdj" :value="d.id" @click="djDaFen(d)" :checked="cepingDjmxb.dcId==d.id">-->
      <!--              <label :for="i"></label>-->
      <!--            </div>-->
      <!--          </label>-->
      <!--        </div>-->
      <!--      </div>-->
    </div>
    <!--    把logo放在父级页面去了-->
    <!--    <div class="flex justifyContentSpaceBetween " style=" height:100px;">-->
    <!--        <div>-->
    <!--            &lt;!&ndash; 添加说明 &ndash;&gt;-->
    <!--            <div class="shuoMing">★鼠标移至二级指标项，见具体说明。</div>-->
    <!--            <div class="shuoMing">★请对指标进行差异化评分（所有指标不能全为同一分值），否则无法提交。</div>-->
    <!--            <div class="shuoMing">★点击“测评结果查询”按钮，可查看测评对象及测评结果。</div>-->
    <!--        </div>-->
    <!--        <div style="position: relative; margin-top:90px;" class="flex justifyContentSpaceBetween ">-->
    <!--           <span><img src="/img/logo.png" width="40" height="40"></span><span class="ml10 font28">共享运营公司测评系统</span>-->
    <!--        </div>-->
    <!--    </div>-->
    <el-dialog
      :visible.sync="ksdialogVisible"
      width="90vw"
      top="3vh"
      append-to-body
    >
      <div class="fontDa">
        <el-container>
          <el-main style="height: 75vh">
            <div class="customTableHeader">
              <!--            <div class="customTableTitle">{{ cepingHdglb.hdName }} 评价规则</div>-->
              <div class="customTableTitle">
                {{ cepingHdglCppmxbInfo.cppName }} 评价规则
              </div>
            </div>
            <div class="cpTable">
              <el-table
                :data="tableData"
                :span-method="objectSpanMethod"
                :cell-style="setCellStyle"
                :row-class-name="tableRowClassName"
              >
                <el-table-column
                  prop="zbName1"
                  label="一级指标"
                  align="center"
                  min-width="200"
                >
                  <template slot-scope="scope">
                    {{ scope.row.zbName1 }}
                  </template>
                </el-table-column>
                <el-table-column
                  prop="zbName2"
                  label="二级指标"
                  align="center"
                  min-width="200"
                  v-if="zbCj > 1"
                >
                </el-table-column>
                <el-table-column
                  prop="zbName3"
                  label="三级指标"
                  align="center"
                  min-width="200"
                  v-if="zbCj > 2"
                >
                </el-table-column>
                <el-table-column
                  prop="tsNr"
                  label="评价要点和标准"
                  min-width="580"
                >
                  <!-- <template slot-scope="scope">
                    <div class="ssss">{{scope.row.tsNr}}</div>
                  </template> -->
                </el-table-column>
              </el-table>
            </div>
          </el-main>
        </el-container>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="ksdialogVisible = false">取消</el-button>
      </span>
    </el-dialog>
    <el-dialog
      title="述职报告"
      :visible.sync="bgdialogVisible"
      width="90vw"
      top="3vh"
      append-to-body
    >
      <div class="fontDa">
        <iframe :src="bgUrl" style="width: 100%; height: 75vh"></iframe>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="bgdialogVisible = false">取消</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import {
  xpInfo,
  daFenCp,
  daFenDj,
  queryBcpUserSzbg,
} from "@/api/ceping/cepinghdglxpxxb";
import { getPreview } from "@/util/util";

export default {
  name: "cpIndexXp",
  data() {
    return {
      shuxing: "top-end",
      show: false,
      df: true,
      cepingHdglXpxxb: {},
      cepingHdglb: {},
      cepingHdglXpxxDfjlbList: [],
      cepingHdglCppmxbInfo: {},
      cepingXmmxbList: [],
      cepingGzmxbList: [],
      cepingCpgzBcpmxb: {},
      cepingCpgzCpmxb: {},
      cepingCpgzCpmxCppzb: {},
      cepingDjmxbList: [],
      cepingCpgzBcpmxbUser: {},
      cepingCpgzBcpmxbDept: {},
      cepingXmmxbObj: {},
      fzbList: [],
      zbCj: 2, //指标层级
      tableColumn: [],
      tableHeader: [],
      tableData: [], //指标结构
      cepingDjmxb: {},
      ksdialogVisible: false,
      bgdialogVisible: false,
      bgUrl: "",
      resultFlag: true,
      tempIndexToFzId: [], //临时记录本页面每行答题与选项的对应关系，解决在系统性能较差情况下，用户操作选择相同选项
    };
  },
  watch: {
    show: function () {},
  },
  methods: {
    initConfig(id) {
      this.show = false;
      this.df = true;
    },

    initXp(id) {
      this.show = false;
      this.df = true;
      xpInfo(id).then((res) => {
        this.cepingHdglXpxxb = res.data.data.cepingHdglXpxxb;
        this.cepingHdglCppmxbInfo = res.data.data.cepingHdglCppmxbInfo;
        this.cepingHdglb = res.data.data.cepingHdglb;
        this.cepingHdglXpxxDfjlbList = res.data.data.cepingHdglXpxxDfjlbList;
        this.cepingXmmxbList = res.data.data.cepingXmmxbList;
        this.cepingGzmxbList = res.data.data.cepingGzmxbList;
        this.cepingCpgzBcpmxb = res.data.data.cepingCpgzBcpmxb;
        this.cepingCpgzCpmxb = res.data.data.cepingCpgzCpmxb;
        this.cepingCpgzCpmxCppzb = res.data.data.cepingCpgzCpmxCppzb;
        this.cepingDjmxbList = res.data.data.cepingDjmxbList;
        this.cepingCpgzBcpmxbUser = res.data.data.cepingCpgzBcpmxbUser;
        this.cepingCpgzBcpmxbDept = res.data.data.cepingCpgzBcpmxbDept;
        this.init();
      });
    },
    setCellStyle(row, col,rowIndex,colIndex) {
      if(row.columnIndex==1){
        return {'float':'left','border':'0px'} 
        // float:left
      }
    },
    init() {
      this.cepingXmmxbObj = {};
      this.zbCj = 1;
      for (var i in this.cepingXmmxbList) {
        this.cepingXmmxbObj[this.cepingXmmxbList[i].id] =
          this.cepingXmmxbList[i];
        if (this.zbCj < this.cepingXmmxbList[i].zbDj) {
          this.zbCj = this.cepingXmmxbList[i].zbDj;
        }
      }
      var zbList = [];
      for (var i in this.cepingXmmxbList) {
        if (this.cepingXmmxbList[i].zbQz > 0) {
          let info = this.cepingXmmxbList[i];
          if (info.zbDj == 1) {
            info.zbName1 = info.zbMc;
            info.zbName2 = "";
            info.zbName3 = "";
          }
          if (info.zbDj == 2) {
            info.zbName1 = this.cepingXmmxbObj[info.pid].zbMc;
            info.zbName2 = info.zbMc;
            info.zbName3 = "";
          }
          if (info.zbDj == 3) {
            info.zbName1 =
              this.cepingXmmxbObj[this.cepingXmmxbObj[info.pid].pid].zbMc;
            info.zbName2 = this.cepingXmmxbObj[info.pid].zbMc;
            info.zbName3 = info.zbMc;
          }
          zbList.push(info);
        }
      }

      function compareZb(a, b) {
        return a.zbPx - b.zbPx;
      }


      var zzList = [];
      if (this.zbCj == 1) {
        zzList = zbList.sort(compareZb);
      }
      if (this.zbCj == 2) {
        var ls = [];
        for (var i in this.cepingXmmxbList) {
          if (this.cepingXmmxbList[i].pid == 0) {
            ls.push(this.cepingXmmxbList[i]);
          }
        }
        ls = ls.sort(compareZb);
        for (var j in ls) {
          var xls = [];
          var qz = 0;
          for (var i in this.cepingXmmxbList) {
            if (this.cepingXmmxbList[i].pid == ls[j].id) {
              xls.push(this.cepingXmmxbList[i]);
              qz += this.cepingXmmxbList[i].zbQz;
            }
          }
          if (xls.length == 0) {
            ls[j].zbQz1 = ls[j].zbQz;
            if (ls[j].zbQz > 0) {
              zzList.push(ls[j]);
            }
          } else {
            var xxls = xls.sort(compareZb);
            for (var k in xxls) {
              xxls[k].zbQz1 = qz;
              if (xxls[k].zbQz > 0) {
                zzList.push(xxls[k]);
              }
            }
          }
        }
      }
      if (this.zbCj == 3) {
        var ls = [];
        for (var i in this.cepingXmmxbList) {
          if (this.cepingXmmxbList[i].pid == 0) {
            ls.push(this.cepingXmmxbList[i]);
          }
        }
        ls = ls.sort(compareZb);
        for (var j in ls) {
          var xls = [];
          var qz = 0;
          for (var i in this.cepingXmmxbList) {
            if (this.cepingXmmxbList[i].pid == ls[j].id) {
              xls.push(this.cepingXmmxbList[i]);
              qz += this.cepingXmmxbList[i].zbQz;
            }
          }
          if (xls.length == 0) {
            ls[j].zbQz1 = ls[j].zbQz;
            if (ls[j].zbQz > 0) {
              zzList.push(ls[j]);
            }
          } else {
            var xxls = xls.sort(compareZb);
            for (var k in xxls) {
              var xls1 = [];
              var qz1 = 0;
              for (var ii in this.cepingXmmxbList) {
                if (this.cepingXmmxbList[ii].pid == xxls[k].id) {
                  xls1.push(this.cepingXmmxbList[ii]);
                  qz += this.cepingXmmxbList[ii].zbQz;
                  qz1 += this.cepingXmmxbList[ii].zbQz;
                }
              }
              if (xls1.length == 0) {
                xxls[k].zbQz1 = xxls[k].zbQz;
                if (xxls[k].zbQz > 0) {
                  zzList.push(xxls[k]);
                }
              } else {
                var xxls1 = xls1.sort(compareZb);
                for (var k1 in xxls1) {
                  xxls1[k1].zbQz1 = qz1;
                  if (xxls1[k1].zbQz > 0) {
                    zzList.push(xxls1[k1]);
                  }
                }
              }
            }
          }
        }
      }
      //补充已有打分
      for (var i in zzList) {
        for (var j in this.cepingHdglXpxxDfjlbList) {
          if (this.cepingHdglXpxxDfjlbList[j].zbId == zzList[i].id) {
            zzList[i].fzId = this.cepingHdglXpxxDfjlbList[j].fzId;
            zzList[i].fzName = this.cepingHdglXpxxDfjlbList[j].fzName;
            zzList[i].fzFz = this.cepingHdglXpxxDfjlbList[j].fzFz;
            zzList[i].dfId = this.cepingHdglXpxxDfjlbList[j].id;
          }
        }
      }
      this.fzbList = [];
      for (var i in zzList) {
        if (this.fzbList.indexOf(zzList[i].zbName1) == -1) {
          this.fzbList.push(zzList[i].zbName1);
        }
      }
      this.tableData = zzList;
      this.tableData.forEach((item) => {
        item.tsNr =
          item.tsNr && decodeURIComponent(decodeURIComponent(item.tsNr));
      });
      this.tempIndexToFzId = this.tableData.map((item) => {
        return item.fzId;
      });
      this.tableHeader = [];
      for (var i in this.cepingGzmxbList) {
        if (this.cepingGzmxbList[i].fzSsz) {
          var find = this.tableHeader.find(
            (item) => item == this.cepingGzmxbList[i].fzSsz
          );
          if (!find) {
            this.tableHeader.push(this.cepingGzmxbList[i].fzSsz);
          }
        }
        // if(this.cepingGzmxbList[i].fzSsz){
        //   this.tableHeader.push(this.cepingGzmxbList[i].fzSsz);
        // }
      }
      // for (var i in this.cepingGzmxbList) {
      //   if (this.cepingGzmxbList[i].fzSsz == "优秀") {
      //     this.tableHeader.push("优秀");
      //     break;
      //   }
      // }
      // for (var i in this.cepingGzmxbList) {
      //   if (this.cepingGzmxbList[i].fzSsz == "较好") {
      //     this.tableHeader.push("较好");
      //     break;
      //   }
      // }
      // for (var i in this.cepingGzmxbList) {
      //   if (this.cepingGzmxbList[i].fzSsz == "一般") {
      //     this.tableHeader.push("一般");
      //     break;
      //   }
      // }
      // for (var i in this.cepingGzmxbList) {
      //   if (this.cepingGzmxbList[i].fzSsz == "较差") {
      //     this.tableHeader.push("较差");
      //     break;
      //   }
      // }

      function compareGz(a, b) {
        return a.fzPx - b.fzPx;
      }

      this.tableColumn = this.cepingGzmxbList.sort(compareGz);
      this.cepingDjmxb = {};
      if (
        (this.cepingHdglXpxxDfjlbList != null) &
        (this.cepingHdglXpxxDfjlbList.length > 0)
      ) {
        this.cepingHdglXpxxDfjlbList.forEach((r) => {
          if (r.dfLx == 1) {
            this.cepingDjmxb = r;
          }
        });
      }

      this.show = true;
    },
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
      if (this.zbCj == 1) {
        return {
          rowspan: 1,
          colspan: 1,
        };
      } else {
        if (columnIndex === 0) {
          if (
            rowIndex > 0 &&
            this.tableData[rowIndex].zbName1 ==
              this.tableData[rowIndex - 1].zbName1
          ) {
            return {
              rowspan: 0,
              colspan: 1,
            };
          } else {
            var j = 0;
            for (var i = rowIndex; i < this.tableData.length; i++) {
              if (
                this.tableData[rowIndex].zbName1 == this.tableData[i].zbName1
              ) {
                j++;
              } else {
                break;
              }
            }
            return {
              rowspan: j,
              colspan: 1,
            };
          }
        }
        if (this.zbCj == 3 && columnIndex === 1) {
          if (
            rowIndex > 0 &&
            this.tableData[rowIndex].zbName2 ==
              this.tableData[rowIndex - 1].zbName2 &&
            this.tableData[rowIndex].zbName1 ==
              this.tableData[rowIndex - 1].zbName1
          ) {
            return {
              rowspan: 0,
              colspan: 1,
            };
          } else {
            var j = 0;
            for (var i = rowIndex; i < this.tableData.length; i++) {
              if (
                this.tableData[rowIndex].zbName2 == this.tableData[i].zbName2 &&
                this.tableData[rowIndex].zbName1 == this.tableData[i].zbName1
              ) {
                j++;
              } else {
                break;
              }
            }
            return {
              rowspan: j,
              colspan: 1,
            };
          }
        }
      }
    },
    cpDaFen(index, gz) {
      //验证
      let cfYz = 0;
      var lsValue = "";
      lsValue = this.tempIndexToFzId[index];
      this.tempIndexToFzId[index] = gz.id;
      if (this.tempIndexToFzId.length == this.tableData.length) {
        var notSameIndex = this.tempIndexToFzId.findIndex(
          (item) => item != gz.id
        );
        if (notSameIndex == -1) {
          cfYz = 1;
        }
      }

      if (this.tableData.length == 1) {
        cfYz = 0;
      }
      if (cfYz == 1) {
        this.tempIndexToFzId[index] = lsValue;
        this.$notify.closeAll();
        this.$notify.warning({
          // title: '错误',
          message: "您不可以将所有的测评项测评为一样的分值",
          showClose: true,
          duration: 5000,
        });
      } else {
        if(this.resultFlag){
          this.resultFlag=false
          let info = {
            xpCode: this.cepingHdglXpxxb.xpCode,
            cxpCode: this.cepingHdglXpxxb.cxpCode,
            xpId: this.cepingHdglXpxxb.id,
            dfId: this.tableData[index].dfId,
            fzId: gz.id,
            fzName: gz.fzMc,
            fzFz: gz.fzFs,
          };
          daFenCp(info).then((res) => {
            if (res.data.code == "0") {
              this.$set(this.tableData[index], "fzId", gz.id);
              this.$set(this.tableData, index, this.tableData[index]);
              this.cepingHdglXpxxb = res.data.data.cepingHdglXpxxb;
            } else {
              this.$notify.closeAll();
              this.$notify.error(res.data.msg);
            }
            this.resultFlag=true
            this.$forceUpdate();
          });
        }
      }
    },
    djDaFen(dj) {
      this.cepingHdglXpxxDfjlbList.forEach((r) => {
        if (r.dfLx == 1) {
          let info = {
            xpCode: this.cepingHdglXpxxb.xpCode,
            cxpCode: this.cepingHdglXpxxb.cxpCode,
            xpId: this.cepingHdglXpxxb.id,
            dfId: r.id,
            dcId: dj.id,
            dcName: dj.dcName,
            dcFz: dj.dcFz,
          };
          daFenDj(info).then((res) => {
            if (res.data.code == "0") {
              this.cepingDjmxb = res.data.data.cepingHdglXpxxDfjlb;
              this.cepingHdglXpxxb = res.data.data.cepingHdglXpxxb;
            } else {
              this.$notify.closeAll();
              this.$notify.error(res.data.msg);
            }
          });
        }
      });
    },
    getClass(i, len) {
      let x = i + 1;
      if (x / len <= 0.25) {
        return "pjyx";
      } else if (x / len <= 0.5) {
        return "pjjh";
      } else if (x / len <= 0.75) {
        return "pjyb";
      } else {
        return "pjjc";
      }
    },
    viewGz() {
      this.ksdialogVisible = true;
    },
    viewBg(obj) {
      var p = {};
      if (obj.bcpDx == "部门") {
        p.bcpDeptId = obj.bcpDeptId;
      } else {
        p.bcpUserId = obj.bcpUserId;
      }
      p.hdId = obj.hdId;
      p.cppId = obj.cppId;
      queryBcpUserSzbg(p).then((res) => {
        var szbg = res.data.data;
        if (szbg) {
          if (szbg.szbgFjdz) {
            this.bgUrl = getPreview(szbg.szbgFjdz) + "&officePreviewType=pdf";
            this.bgdialogVisible = true;
          } else {
            this.$notify.closeAll();
            this.$notify.error("无数据");
          }
        } else {
          this.$notify.closeAll();
          this.$notify.error("无数据");
        }
      });
    },
    yzDf() {
      let cpx = 0;
      for (var i in this.tableData) {
        if (!this.tableData[i].fzId) {
          return 1;
        }
      }
      return 0;
    },
    tableRowClassName({ row, rowIndex }) {
      let fz = this.fzbList.indexOf(this.tableData[rowIndex].zbName1);
      let className = "";
      if (fz % 2 == 0) {
        className = "cpRowNormal";
      } else {
        className = "cpRowstripe";
      }
      return className;
    },
  },
};
</script>

<style scoped>

</style>
<style>
.newline {
  white-space: pre-line !important;
}

</style>
